//
//  SSSegmentItemView2.swift
//  拾舍清洁
//
//  Created by sky.wei on 2023/6/12.
//

import UIKit

class SSSegmentItemView2: UIView {

    var isSelected:Bool = false
    var textL = UILabel()
    var sliderView = UIImageView()

    override public init(frame: CGRect) {
        super.init(frame: frame)
        
        setupUI()
        //整个控件的默认尺寸(和某宝上面的按钮同样大小)
        if frame.isEmpty {self.frame = CGRect(x: 0, y: 0, width: 110, height: 30)}
    }
    
    required public init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        
    }
    
    func setupUI() {
       
        
        let textL = UILabel(frame: CGRect(x: 0, y: 0, width: frame.size.width, height: frame.size.height))
        textL.textAlignment = .center
//        textL.backgroundColor = UIColor.clear
        textL.tag = 100
        textL.font = UIFont.boldSystemFont(ofSize: 16)
        textL.textColor = UIColor(hex: "6D798B")
        self.addSubview(textL)
        self.textL = textL
        
        let sliderView = UIImageView()
        sliderView.image = UIImage(named: "normal_slider")
        sliderView.tag = 200
        sliderView.frame = CGRect(x: textL.center.x - 32, y: textL.frame.size.height/2 + 6, width: 32, height: 6)
        sliderView.isHidden = true
        self.addSubview(sliderView)
        self.sliderView = sliderView
    }

}
